<template>
  <hierTree :data="data" v-bind="attrs" :ref="ref"
    @select="select"
    @add="add"
    @remove="remove"
    @menu="menu"></hierTree>
</template>

<script>
export default {
  name:'pg-tree',
  components: {},
  inject:['anc'],
  data() {
    return {
      ref:'tree',
    };
  },
  props: {
    data:{
        default:()=>{
            return [];
        }
    }
  },
  watch: {},
  computed: {
    attrs(){
        return {
            title:{
                "en-US":'AAA',
                "zh-CN": 'AAA'
            }[this.G_Locale],
            rootId:'root',
            nameId:'id',
            namePid:'parentId',
            nameTitle:'name',
            rootEnable:false,
            menuEnable:true,
            addEnable:false,
            removeEnable:true,
            menus:[
                {
                    title:{
                        "en-US":'add1',
                        "zh-CN": '添加1'
                    }[this.G_Locale],
                    disabled:false,
                }
            ]
        }
    },
  },
  created() {},
  mounted() {
    this.$nextTick(()=>{
      this.$set(this.anc.vms,this.ref, this);
    })
  },
  methods: {
    select(item){

    },
    add(item){

    },
    remove(item){

    },
    menu(menu,item){
        
    },
    setTree(fn){
      this.$children[0].setTree(fn)
    }
  }
};
</script>
<style scoped>
</style>